<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title>订单管理</title>
    <link rel="stylesheet" href="/Public/Leader/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/Public/Leader/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Leader/css/bootstrap-datetimepicker.css"/>
    <style type="text/css">
        .order-list a {
            position: relative;
        }

        .order-list span {
            float: right;
            margin-right: 20px;
        }

        .trhead td {
            background: #efefef;
            text-align: center
        }

        .trbody td {
            text-align: center;
            vertical-align: top;
            border-left: 1px solid #f2f2f2;
            overflow: hidden;
            font-size: 12px;
        }

        .trorder {
            background: #f8f8f8;
            border: 1px solid #f2f2f2;
            text-align: left;
        }

        .ops {
            border-right: 1px solid #f2f2f2;
            text-align: center;
        }

        .pagination ul {
            display: inline-block;
            margin-left: 0;
            margin-bottom: 0;
            -webkit-border-radius: 3px;
            -moz-border-radius: 3px;
            border-radius: 3px;
            font-size:0;
        }

        .pagination ul > li {
            display: inline-block;
            font-size:14px;
            border:1px solid #ddd;
        }
        .pagination ul > *:not(:first-child){
            margin-left:-1px;
        }
        .pagination ul > span{
            border:1px solid #ddd;
        }
        .pagination ul > li > a, .pagination ul > span {
            /*float: left;*/
            display:inline-block;
            padding: 0 14px;
            line-height: 38px;
            text-decoration: none;
            background-color: #ffffff;
            font-size:14px;
        }
        .pagination ul > li:last-child{
            margin-left:15px;
            border:none;
        }
        .pagination ul > li:last-child #pages{
            margin:0 6px;
        }
        thead tr th {
            text-align: center;
        }
        .panel-body td{
            font-size: 14px;
        }
    </style>
</head>
<body>
    <style>
    .pagination .current{
        float: left;
    padding: 0 14px;
    line-height: 38px;
    text-decoration: none; 
    border-left-width: 0;
    }
        
</style>
<div id="topbar" class="top-navigation dark-bg ">
            <nav class="navbar   dark-bg " role="navigation" style="width:85%;margin:auto;">
                <div class="navbar-header" style="width:200px;">
                    <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
                        <i class="fa fa-reorder"></i>
                    </button>
                    <a class="navbar-brand" href="<?php echo U('Index/index');?>">小易出行</a>
                </div>
                <div class="navbar-collapse collapse" id="navbar">
                    <ul class="nav navbar-nav dark-bg">
                        

                        <li <?php if($table == 'index'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Index/index');?>"> 首页</a>
                        </li>

                        <li <?php if($table == 'order'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Order/orderadmin');?>">订单管理</a>
                        </li>

                        <li <?php if($table == 'pay'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Pay/paycount');?>">交易中心</a>
                        </li>
                        <li <?php if($table == 'article'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Article/lst');?>">文章</a>
                        </li>
                        <li <?php if($table == 'wx'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Wx/wx_menu/wid/1');?>">微信管理</a>
                        </li>
                        <li <?php if($table == 'line'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Line/lineadmin');?>">线路管理</a>
                        </li>
                        <li <?php if($table == 'user'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('User/userinfo');?>">用户管理</a>
                        </li>
                        <li <?php if($table == 'useradmin'): ?>class="active"<?php endif; ?>>
                            <a href="<?php echo U('Useradmin/userinfo');?>">系统管理</a>
                        </li>

                    </ul>
                    <ul class="nav navbar-top-links navbar-right">
                        <li class="dropdown">
                            <a aria-expanded="false" role="button" href="#" class="dropdown-toggle" data-toggle="dropdown" style="position:relative;" onclick="$(this).find('span').toggleClass('deg180')">
                                <name style="width: 80px;white-space:nowrap;overflow:hidden;text-overflow: ellipsis;display: block;text-align: center"><?php echo session('username');?></name>
                                <span class="caret" style="position: absolute;top: 22px;right: 12px;"></span></a>
                            <ul role="menu" class="dropdown-menu">
                                <li>
                                    <a onclick="return confirm('您确定要退出吗？')" tabindex="-1" href="<?php echo U('Login/Logout');?>">退出</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </div>
    <div class="wrapper main-wrapper wrapper-content ">
        <div class="page-menubar">
    <div class="menu-header">订单管理</div>
    <ul class="order-list">
        <li
        <?php if(($datas['res']) == "3"): ?>class="active"<?php endif; ?>
        >
        <a href="<?php echo U('Order/orderadmin',array('statu'=>5,'res'=>3));?>">待支付 <span class="status0"></span></a>
        </li>
        <li
        <?php if(($datas['res']) == "4"): ?>class="active"<?php endif; ?>
        >
        <a href="<?php echo U('Order/orderadmin',array('statu'=>6,'res'=>4));?>">已完成 <span class="status0"></span></a>
    </li>



<li
    <?php if(($datas['open_status']) == "1"): ?>class="active"<?php endif; ?>
    >
    <a href="<?php echo U('Order/orderadmin',array('open_status'=>1));?>">派单列表 <span class="status0"></span></a>
</li>

<li
    <?php if(($open_status) == "2"): ?>class="active"<?php endif; ?>
    >
    <a href="<?php echo U('Order/addOrder',array('open_status'=>2));?>">新建订单 <span class="status0"></span></a>
</li>


<li <?php if(($datas['res']) == "2"): ?>class="active"<?php endif; ?>>

<a href="<?php echo U('Order/orderadmin',array('res'=>2));?>">全部订单<span class="all"></span></a>
</li>


<li <?php if(($res) == "1"): ?>class="active"<?php endif; ?>>
<a href="<?php echo U('Order/withdraw');?>">提现列表<span class="all"></span></a>
</li>

</ul>
</div>
<!--主要内容-->
<div class="page-content" style="display: block;">
    <div class="page-heading" style="position:relative;">
        <h2>订单列表</h2>
        <!--<a href="<?php echo U('Order/neworder');?>" target="_blank" class="btn btn-primary" style="position:absolute;right: 0;top: 10px;">新建订单</a>-->
        <!-- <button type="button" class="btn btn-default" onclick="order_print()" style="margin:10px 0;">订单打印</button> -->
    </div>
    <div class="page-body" style="margin-top:20px;">
        <form action="" method="get" class="form-horizontal table-search row" id="form1" role="form">
            <div class="col-sm-6">
                <!-- <input type="hidden" value="1" name='p'> -->
                <div class="form-group">
                    <label class="col-sm-3 control-label">乘客姓名：</label>
                    <div class="col-sm-8">
                        <input type="text" name="kehuname" id="kehuname"  placeholder="输入客户姓名" class="form-control">
                    </div>
                </div>
                <!-- <div class="form-group">
                    <label class="col-sm-2 control-label">电话：</label>
                    <div class="col-sm-8">
                        <input type="text" name="dianhua" id="dianhua"  placeholder="输入电话" class="form-control">
                    </div>
                </div> -->
                
                <div class="form-group">
                    <label class="col-sm-3 control-label">下单时间：</label>
                    <div class="col-sm-8">
                        <input type="text" name="wtime" id="starttime"   value="<?php echo ($datas['wtime']); ?>" placeholder="选择起始时间" class="form-control pull-left" readonly="readonly" style="width:49%;" />
                        <span class="text-center pull-left" style="width:2%;line-height: 34px;">-</span>
                        <input type="text" name="ntime" id="endtime" placeholder="选择终止时间" class="form-control pull-left" readonly="readonly" style="width:49%;" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">预约时间：</label>
                    <div class="col-sm-8">
                        <input type="text" name="wtime2"  value="<?php echo ($datas['wtime2']); ?>" id="starttime2" placeholder="选择起始时间" class="form-control pull-left" readonly="readonly" style="width:49%;" />
                        <span class="text-center pull-left" style="width:2%;line-height: 34px;">-</span>
                        <input type="text" name="ntime2" id="endtime2" placeholder="选择终止时间" class="form-control pull-left" readonly="readonly" style="width:49%;" />
                    </div>
                </div>
                <div class="form-group">
                        <label class="col-sm-3 control-label">支付状态：</label>
                        <div class="col-sm-8">
                            <select name="statu" class="input-sm select-md col-sm-4" style="padding:0 5px;">
    
                                <option value="" <?php if($datas['statu'] == ''): ?>selected = "selected"<?php endif; ?>>支付状态</option>
                                <option value="5" <?php if($datas['statu'] == 5): ?>selected = "selected"<?php endif; ?>>未支付</option>
                                <option value="6" <?php if($datas['statu'] == 6): ?>selected = "selected"<?php endif; ?>>已支付</option>
                                <option value="7" <?php if($datas['statu'] == 7): ?>selected = "selected"<?php endif; ?>>已退款</option>
                            </select>
                        </div>
                    </div>
            </div>
            <div class="col-sm-6">
                    <div class="form-group">
                            <label class="col-sm-3 control-label">司机姓名：</label>
                            <div class="col-sm-8">
                                <input type="text" name="xingming" id="xingming" value="<?php echo ($datas['xingming']); ?>" placeholder="输入司机姓名" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">司机电话：</label>
                            <div class="col-sm-8">
                                <input type="text" name="dianhua"  id="dianhua" value="<?php echo ($datas['dianhua']); ?>" placeholder="输入司机电话" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                                <label class="col-sm-3 control-label">排序方式：</label>
                                <div class="col-sm-8">
                                    <select name="is_px" value="<?php echo ($datas['is_px']); ?>" class="input-sm select-md col-sm-4" style="padding:0 5px;">
                                        <option value="1">下单时间排序</option>
                                        <!-- <option value="2">预约时间排序</option> -->
                                    </select>
                                </div>
                            </div>
                <div class="form-group">
                        <label class="col-sm-3 control-label">支付方式：</label>
                        <div class="col-sm-8">
                            <select name="pay_status_sk" class="input-sm select-md col-sm-4" style="padding:0 5px;">
                                <option value="0" <?php if($datas['pay_status_sk'] == 0): ?>selected = "selected"<?php endif; ?>>全部</option>
                                <option value="2" <?php if($datas['pay_status_sk'] == 2): ?>selected = "selected"<?php endif; ?>>线上</option>
                                <option value="1" <?php if($datas['pay_status_sk'] == 1): ?>selected = "selected"<?php endif; ?>>现金</option>
                            </select>
                        </div>
                    </div>
                <!-- <div class="form-group">
                    <label class="col-sm-2 control-label">选择司机：</label>
                    <div class="col-sm-8">
                        <select name="sj" class="input-sm select-md col-sm-4" style="padding:0 5px;">
                            <option value="">选择司机</option>
                            <?php if(is_array($sj)): $i = 0; $__LIST__ = $sj;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vp): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vp["openid"]); ?>"><?php echo ($vp["xingming"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </div>
                </div> -->
               

                
            </div>







            <div class="page-toolbar row m-b-sm m-t-sm">
                <div class="col-sm-12 pull-left">
                    <div class="input-group col-sm-12">
                        <div class="col-sm-1">

                        </div>
                        <div class="col-sm-9">
                            <span class="input-group-btn pull-left">
                                <button class="btn btn-sm btn-primary" type="button" onclick="fomrReset1()"> 搜索</button>
                            </span>

                            <span class="input-group-btn pull-left" style="margin-left: 50px;">
                            	<a class="btn btn-sm btn-primary" id="excel" href="<?php echo U('Order/excel',array('kehuname'=>$kehuname,'wtime'=>$wtime,'ntime'=>$ntime,'wtime2'=>$wtime2,'ntime2'=>$ntime2,'statu'=>$statu,'xingming'=>$xingming,'dianhua'=>$dianhua,'is_px'=>$is_px,'pay_status_sk'=>$pay_status_sk));?>">导出订单</a>
                            </span>
							
                            <span class="input-group-btn pull-left" style="margin-left: 80px;">
                                <a class="btn btn-sm btn-primary" id="excel" href="<?php echo U('Order/orderadmin',array('res'=>2));?>">清空</a>
                            </span>

                        </div>

                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="panel panel-default" style="margin-top:20px;">
        <div class="panel-body">
            <ul class="fenxilist clearfix">
                <li class="col-sm-3">
                    <div>订单总笔数(笔)</div>
                    <div><?php echo ($bcount?$bcount:0); ?></div>

                </li>
                <li class="col-sm-3">
                    <div>已支付笔数(笔)</div>
                    <div>￥<?php echo ($bycount?$bycount:0); ?></div>
                </li>
                <li class="col-sm-3">
                    <div>未支付笔数(笔)</div>
                    <div>￥<?php echo ($bwcount?$bwcount:0); ?></div>
                </li>
                <li class="col-sm-3">
                    <div>&nbsp;</div>
                    <div>&nbsp;</div>

                </li>

                <li class="col-sm-3">
                    <div>订单总金额(元)</div>
                    <div>￥<?php echo ($bcount2?$bcount2:0); ?></div>
                </li>
                <li class="col-sm-3">
                    <div>已支付金额(元)</div>
                    <div>￥<?php echo ($bycount2?$bycount2:0); ?></div>
                </li>
                <li class="col-sm-3">
                    <div>未支付金额(元)</div>
                    <div>￥<?php echo ($bwcount2?$bwcount2:0); ?></div>
                </li>
                <li class="col-sm-3">
                    <div>余额支付金额(元)</div>
                    <div>￥<?php echo ($yycount?$yycount:0); ?></div>

                </li>
            </ul>
        </div>
    </div>
    <div class="panel panel-default" style="margin-top: 20px;">
        <div class="panel-body" style="text-align: center;">
            <table class="table table-responsive">
                <thead>
                    <tr style="background:#f9f9f9;">
                        <th>#</th>
                        <th>司机</th>
                        <th>乘客电话</th>
                        <th>人数</th>
                        <th>出发地</th>
                        <th>目的地</th>
                        <th>价格</th>
                        <!-- <th>订单类型</th> -->
                        <th>支付状态</th>
                        <th>下单时间</th>
                        <th>发车时间</th>
                        <th>订单状态</th>
                        <!-- <th style="width: 60px;"></th> -->
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if(is_array($olist)): $i = 0; $__LIST__ = $olist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($vo["id"]); ?></td>
                            <td width='60px;'><?php echo get_usertel($vo['openid']);?></present></td>
                            <td width='100px;'><?php echo ($vo["mobile"]); ?></td>
                            <td width='50px;'><?php echo ($vo["num"]); ?></td>
                            <td width='100px;'><a href='javascript:void(0)' onclick="kcshow('<?php echo ($vo["start_x"]); ?>', 1)"><?php echo ($vo["start"]); ?></a>
                            </td>
                            <td width='100px;'><a href='javascript:void(0)'
                              onclick="kcshow('<?php echo ($vo["end_x"]); ?>', 2)"><?php echo ($vo["end"]); ?></a></td>
                              <td><?php echo ($vo["price"]); ?>/人</td>
                              <!-- <td><?php echo ($vo["fs"]); ?></td> -->

                              <td>
                                <?php if($vo['pay_statu'] == 1): if($vo['pay_status_sk'] == 1): ?>现金支付
                                        <?php else: ?>
                                        线上支付<?php endif; ?>
                                <?php else: ?>
                                    未支付<?php endif; ?>
                              


                              </td>

                            <td><?php echo (date('Y-m-d H:i',$vo['addtime'])); ?></td>
                            <td><?php echo ($vo['starttime']); ?></td>

                            <!-- <td><?php echo ($vo['starttime']); ?></td> -->
                            <td>

                              <!-- <?php if($vo['order_statu'] != '2'): ?><a onclick="return confirm('请确认到达')"
                                  href="/admin.php/order/dd/id/<?php echo ($vo["id"]); ?>">已到达 </a>
                               <?php elseif($vo['order_statu'] == '2'): ?>
                                  已完成<?php endif; ?> -->

                              <?php if($vo['status'] == '0'): ?>创建订单
                              <?php elseif($vo['status'] == '1'): ?>
                                  发车
                              <?php elseif($vo['status'] == '2'): ?>
                              到达固定乘车点
                              <?php elseif($vo['status'] == '3'): ?>
                              接到乘客
                              <?php elseif($vo['status'] == '4'): ?>
                              到达终点站
                              <?php elseif($vo['status'] == '5'): ?>
                              确认订单
                                  <?php elseif($vo['status'] == '6'): ?>
                                  订单完成
                                  <?php elseif($vo['status'] == '7'): ?>
                                  撤销订单<?php endif; ?>


                            </td>
                          <td>
                            <?php if($datas['open_status'] != 1): ?><a href='javascript:void(0)' onclick="bcshow(<?php echo ($vo['id']); ?>)">
                                <i class="glyphicon glyphicon-eye-open"></i></a>
                                
                                <?php if($order_cwstatus == 2): ?><a href='javascript:void(0)' onclick="table1(<?php echo ($vo['id']); ?>)"><i class="glyphicon glyphicon-pencil"></i></a><?php endif; ?> 

                                <a onclick="return confirm('正在删除，请确认')" href="/admin.php/order/del/id/<?php echo ($vo["id"]); ?>"><i class="glyphicon glyphicon-remove-sign"></i>
                                 </a>
                                 <?php else: ?>

                                 <?php if($vo['newpay'] == 1): ?><a href="javascript:void(0)" onclick="bcshow_table(<?php echo ($vo['id']); ?>)" class="btn btn-sm btn-primary">
                                 派单
                                 </a><?php endif; endif; ?>


                                </td>
                            </tr>
                            <!--<tr style="background:#f9f9f9;">-->
                                <!--<td colspan="17" style="text-align:right;">-->
                                    <!---->
                                    <!--<?php if($vo['siji'] == '' and 1 == 2): ?>-->
                                        <!--<b>分配司机:</b>-->
                                        <!--<select name="p_id" onchange="fps()"  data-id="<?php echo ($vo['id']); ?>">-->
                                            <!--<option value="">选择司机</option>-->
                                            <!--<?php if(is_array($sj)): $i = 0; $__LIST__ = $sj;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vp): $mod = ($i % 2 );++$i;?>-->
                                                <!--<option value="<?php echo ($vp["xingming"]); ?>"><?php echo ($vp["xingming"]); ?></option>-->
                                            <!--<?php endforeach; endif; else: echo "" ;endif; ?>-->
                                        <!--</select>-->
                                        <!--&lt;!&ndash;<a data-toggle="ajaxModal" href="javascript:;">焦振凯</a>&ndash;&gt;-->
                                        <!--<?php else: ?>-->
                                        <!--&lt;!&ndash; <b>司机:</b> &ndash;&gt;-->
                                        <!--<a data-toggle="ajaxModal" href="javascript:;"><?php echo ($vo["siji"]); ?></a>-->
                                    <!--<?php endif; ?>-->

                                <!--</td>-->
                               <!---->
                            <!--</tr>-->
                            <!--<tr>-->
                                <!--<td colspan="12"></td>-->
                            <!--</tr>--><?php endforeach; endif; else: echo "" ;endif; ?>

                    </tbody>
                </table>
                <div id="pages">
                <?php echo ($page); ?>
                </div>
            </div>
        </div>

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" style="width:85%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                    data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    线路信息
                </h4>
            </div>
            <div>
                <div id='listsp'></div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="width:85%;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close"
            data-dismiss="modal" aria-hidden="true">
            &times;
        </button>
        <h4 class="modal-title" id="myModalLabel">
            订单信息
        </h4>
    </div>
    <div>
        <div id='listsp2'></div>
    </div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<div class="modal fade" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="width:90%;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
                订单打印
            </h4>
        </div>

        <div id='order'>
            <div id="ordercount">
                <table class="table table-bordered">
                    <caption>&nbsp;</caption>
                    <caption>
                        交易统计
                    </caption>
                    <thead>
                        <tr>
                            <th colspan="4">统计区间<?php echo ($wtime); ?>--<?php echo ($ntime); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>交易笔数：<?php echo ($bcount); ?></td>
                            <td>已支付笔数：<?php echo ($bycount); ?></td>
                            <td>已完成：<?php echo ($bywcount); ?></td>
                            <td>未完成：<?php echo ($bwwcount); ?></td>
                        </tr>
                        <tr>
                            <td colspan="2">交易金额：<?php echo ($bcount2); ?>;&nbsp;&nbsp;余额支付：<?php echo ($yycount); ?></td>
                            <td>已支付：<?php echo ($bycount2); ?></td>
                            <td>未支付：<?php echo ($bwcount2); ?></td>
                        </tr>

                    </tbody>
                </table>
                <div id="list2">

                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" onclick="print()">订单打印</button>
    </div>

</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</div>
</div>
</body>
<!-- <script src="/Public/Leader/js/jquery.js" type="text/javascript" charset="utf-8"></script> -->
<script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
        function fps(){
            // var sj = $(this).attr('data-id');
            // alert(sj);
        }
    </script>
<script src="/Public/Leader/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/Leader/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
<script language="javascript" type="text/javascript" src="/Public/jquery.PrintArea.js"></script>
<script src="/Public/Leader/layui/layui.all.js" type="text/javascript" charset="utf-8"></script>

<script>
    function print() {
        $("#order").printArea();


    }

    function order_print() {
        $.ajax({
            type: "POST",
            url: "/admin.php/order/orderprint",

            cache: false,
            data: {
                sql: "<?php echo ($plist); ?>",

            },

            success: function (data) {

                $('#list2').html(data);
                $('#myModal4').modal('show');
            }


        });


    }

    function kcshow(bcbh, fs) {
        $.ajax({
            type: "POST",
            url: "/admin.php/order/kcshow",
            cache: false,
            data: {
                kcname: bcbh,
                fs: fs

            },
            success: function (data) {
                $('#listsp').html(data);
                $('#myModal').modal('show');
            }


        });


    }

    function table1(orderid) {
        layer.confirm('允许该订单进行报单?', {
          btn: ['确定', '取消']
         
        }, function(index, layero){
            $.ajax({
                type: "POST",
                url: "/admin.php/order/baodan",
                cache: false,
                data: {
                    orderid: orderid,
                },
                success: function (data) {
                    if(data==1)
                    {
                         layer.alert('修改成功', {icon: 6});

                         setTimeout(function(){ 
                             $(window).attr('location',"/admin.php/order/orderadmin");
                          },3000); 
                         
                    }else
                    {
                        layer.alert('修改失败', {icon: 5});
                    }
                }
            });
          //按钮【按钮一】的回调
        }, function(index){

        });
       
    }


    function bcshow(bcbh) {
        $.ajax({
            type: "POST",
            url: "/admin.php/order/bcshow",

            cache: false,
            data: {
                bcbh: bcbh,

            },
                
            success: function (data) {
                
                $('#listsp2').html(data);
                $('#myModal2').modal('show');
            }


        });


    }

    function bcshow_table(bcbh) {
        $.ajax({
            type: "POST",
            url: "/admin.php/order/bcshow_table",

            cache: false,
            data: {
                bcbh: bcbh,
            },
            success: function (data) {
                $('#listsp2').html(data);
                $('#myModal2').modal('show');
            }
        });
    }
</script>
<script>
    $(function () {
        var myDate = new Date();
        $('#starttime2').datetimepicker({
            minView: 0, //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
        $('#endtime2').datetimepicker({
            minView: 0, //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
        $('#starttime').datetimepicker({
            minView: 0, //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
        $('#endtime').datetimepicker({
            minView: 0, //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });

    })


     function fomrReset()
     {
         document.getElementById("form1").reset();
     }

    $("#pages ul li a").on("click",function (e) {
        var url = $(this).attr("href");
        var formdata = $("#form1").serialize();
        if(url.indexOf('?')<=-1){
            url = url+"?"+formdata;
        }else{
            url = url+"&"+formdata;
        }
        e.preventDefault();
        $(location).attr('href', url);
    });

     function fomrReset1()
     {  
        var url = "<?php echo U('Order/orderadmin');?>";
        var formdata = $("#form1").serialize();
        if(url.indexOf('?')<=-1){
            url = url+"?"+formdata;
        }else{
            url = url+"&"+formdata;
        }
        location.href= url;
     }
</script>
</html>